

const NSYM_UNDEFINED	=	0;	// NOT ANYTHING, IN NO LIST, UNREFERENCED
const NSYM_ASEG		=	2;	// SEGMENT 'AT' KIND, IN PUBLIC LIST
const NSYM_RELOC	=	4;	// NORMAL RELOCATABLE, IN PUBLIC LIST
const NSYM_COMM_NEAR	=	6;	// NORMAL, IN COMMUNAL LIST
const NSYM_COMM_FAR	=	8;	// NORMAL, IN COMMUNAL LIST, FAR
const NSYM_COMM_HUGE	=	10;	// HUGE COMMUNAL, IN COMMUNAL LIST
const NSYM_CONST	=	12;	// X = 5, IN PUBLIC LIST
const NSYM_LIBRARY	=	14;	// NOT DEFINED OR REFERENCED, IN A LIB, NO LIST
const NSYM_IMPORT	=	16;	// SYMBOL IS IMPORTED
const NSYM_PROMISED	=	18;	// PROMISED BY A DEFINE, DOSSEG, LIB
const NSYM_EXTERNAL	=	20;	// UNDEFINED, REFERENCED, IN EXTRN LIST
const NSYM_WEAK_EXTRN	=	22;	// THIS IS IN THE REFERENCED 'WEAK EXTRNS' LIST...
const NSYM_POS_WEAK	=	24;	// THIS REFERENCED HERE AS WEAK EXTRN, NOT IN LIST YET
const NSYM_LIBRARY_LIST	=	26;	// UNDEFINED, REFERENCED, IN A LIB LIST
const NSYM__IMP__UNREF	=	28;	// __imp_ SYMBOL, NOT REFERENCED
const NSYM_ALIASED	=	30;	// HAS AN ALIAS ASSIGNED, REFERENCED
const NSYM_COMDAT	=	32;	// COMDAT SYMBOL
const NSYM_WEAK_DEFINED	=	34;	// REFERENCED WEAK EXTRN, MY DEFAULT HAS BEEN DEFINED, OR AT LEAST 'REFERENCED'
const NSYM_WEAK_UNREF	=	36;	// UNREFERENCED WEAK, IN NO LIST
const NSYM_ALIASED_UNREF =	38;	// UNREFERENCED ALIAS, IN NO LIST
const NSYM_POS_LAZY	=	40;	// MAKING THIS A LAZY
const NSYM_LAZY		=	42;	// REFERENCED LAZY, IN LIST
const NSYM_LAZY_UNREF	=	44;	// UNREFERENCED LAZY, IN NO LIST
const NSYM_ALIAS_DEFINED =	46;	// REFERENCED ALIAS, MY DEFAULT HAS BEEN REFERENCED
const NSYM_LAZY_DEFINED	=	48;	// REFERENCED LAZY, MY DEFAULT HAS BEEN REFERENCED
const NSYM_NCOMM_UNREF	=	50;	// UNREFERENCED NEAR COMMUNAL, IN NO LIST
const NSYM_FCOMM_UNREF	=	52;	// UNREFERENCED FAR COMMUNAL, IN NO LIST
const NSYM_HCOMM_UNREF	=	54;	// UNREFERENCED HUGE COMMUNAL, IN NO LIST
const NSYM__IMP__	=	56;
const NSYM_UNDECORATED	=	58;	// USED BY DEFINE_EXPORTS

const NSYM_SIZE		=	60;	// LENGTH OF THIS LIST

const NSYM_ANDER	=	63;

struct SYMBOL_STRUCT
{
    ubyte _S_NSYM_TYPE;	// UNDEFINED, ASEG, RELOC, PROMISED, ETC **
    ubyte _S_REF_FLAGS;	// REFERENCED FLAG..., FIARQQ FLAG	**
    ushort _S_CV_TYPE3;

    uint _S_NEXT_HASH_GINDEX;	// NEXT SYMBOL IN HASH - LATER IT IS PARAGRAPH OR OS2_SELECTOR #

    uint _S_NEXT_SYM_GINDEX;	// FORWARD LINK	- USED ALWAYS
    uint _S_PREV_SYM_GINDEX;	// BACKWARDS LINK - LATER IT IS OS2_FLAGS

    uint _S_MOD_GINDEX;		// REFERENCING MODULE, MODULE IN LIBRARY, DEFINING MODULE GINDEX
    uint _S_SEG_GINDEX;		// DEFINING LIBRARY, INITIALLY SEGMOD, LATER SEGMENT?

    uint _S_OFFSET;				// OFFSET FROM SEGMOD, LATER OFFSET FROM FRAME - OR TOTAL OFFSET
    _S_CD_SEGMOD_GINDEX	= _S_OFFSET;		// SEGMOD I WILL USE
    _S_ALIAS_SUBSTITUTE_GINDEX	= _S_OFFSET;	// SYMBOL TO USE FOR THIS ONE

    uint _S_LAST_XREF;

  version (any_overlays)
  {
    _S_SECTION_GINDEX = _S_NEXT_HASH_GINDEX;	// LOWEST COMMON SECTION REFERENCED FROM
				// LATER IT BECOMES VECTOR #
    ubyte _S_PLTYPE;		// PLTYPES RECORD
    ubyte _S_PLINK_FLAGS;
    _S_VECTOR = _S_GROUP_GINDEX; // VECTOR INDEX #
  }

    uint _S_NAME_TEXT;
    _S_FLOAT_TYPE = <_S_NAME_TEXT+8>
}


_S_N_CPP_MATCHES	=	(_S_MOD_GINDEX)
_S_N_NCPP_MATCHES	=	(_S_SEG_GINDEX)
_S_LAST_CPP_MATCH	=	(_S_OFFSET)
_S_LAST_NCPP_MATCH	=	(_S_LAST_XREF)


_S_OS2_NUMBER	=	(_S_NEXT_HASH_GINDEX);	// OR PARAGRAPH
_S_OS2_FLAGS	=	(_S_PREV_SYM_GINDEX)

// LIBRARY
_S_LIB_GINDEX	=	_S_SEG_GINDEX;	// DEFINING LIBRARY
_S_LIB_MODULE	=	_S_MOD_GINDEX;	// MODULE # IN LIBRARY

// ALIAS

// WEAK EXTRN
_S_WEAK_DEFAULT_GINDEX	= _S_OFFSET;	// DEFAULT EXTERNAL TO USE IF DEFINED

// LAZY EXTRN
_S_LAZY_DEFAULT_GINDEX	= _S_OFFSET;	// SYMBOL TO USE IF WE CANNOT FIND ME

_S__IMP__DEFAULT_GINDEX	= _S_OFFSET;


PLINK_SYMBOL_REC	RECORD	\
		VECTOR_ALWAYS:1,\
		VECTOR_NEVER:1,\
		VECTOR_TRACK:1,\
		VECTOR_YES:1,\			;SYMBOL IS VECTORED
		MERGE_PUBLIC:1,\
		MERGE_PRIVATE:1,\
		DEBUG_GLOBAL:1


enum S_S
{
	S_DATA_REF:1,
	S_USE_GROUP:1,
	S_WEAK_AGAIN:1,
	S_SPACES:1,
	S_REFERENCED:1,
	S_FLOAT_SYM:1,
	S_HARD_REF:1,
	S_SOFT_REF:1
}

S_NO_CODEVIEW	=	<S_SOFT_REF>

UNDECO_EXACT		=	<S_SOFT_REF>
UNDECO_REFERENCED_1	=	<S_HARD_REF>

_S_REF_MOD_GINDEX	=	_S_MOD_GINDEX		// FIRST MODULE REFERENCING THIS (FOR ERROR_UNDEFINED)

//_S_LAST_XREF	=	_S_OFFSET;			// LINKED LIST OF REFERENCING MODULES
_S_DEFINING_MOD	=	_S_MOD_GINDEX			// MODULE # IF DEFINED NORMALLY (USED DURING XREF OUTPUT)

_S_IMP_NOFFSET	=	(_S_OFFSET)			// OFFSET TO NAME TEXT
_S_IMP_MODULE	=	_S_SEG_GINDEX			// IMPORT MODULE NUMBER (INDEX INTO NEXEHEADER) (AND IMPMOD_GARRAY)
//_S_IMP_FLAGS	=	(_S_OFFSET.LW)			// 0=BYNAME, 1=ORDINAL
_S_IMP_IMPNAME_GINDEX	=	_S_PREV_SYM_GINDEX	// IF IMPORTED BY NAME OR HINT
_S_IMP_ORDINAL	=	_S_PREV_SYM_GINDEX		// IF IMPORTED BY ORDINAL
//_S_IMP_IMPMOD_GINDEX	=	(_S_OFFSET.HW)		// MODULE (IN IMPNAME TABLE)
_S_IMP_NEXT_GINDEX	=	_S_NEXT_SYM_GINDEX	// LIST FOR SCANNING IMPORTS
_S_IMP_JREF_INDEX	=	(_S_OFFSET)		// INDEX INTO IMPCODE SEGMENT

S_IMP_ORDINAL	=	<S_USE_GROUP>


_COMM_NSYM_TYPE		=	<_S_NSYM_TYPE>
_COMM_REF_FLAGS		=	<_S_REF_FLAGS>

_COMM_NEXT_HASH_GINDEX	=	<_S_NEXT_HASH_GINDEX>

_COMM_NEXT_SYM_GINDEX	=	<_S_NEXT_SYM_GINDEX>
_COMM_PREV_SYM_GINDEX	=	<_S_PREV_SYM_GINDEX>

_COMM_MOD_GINDEX	=	<_S_MOD_GINDEX>
_COMM_SIZE_A		=	<_S_SEG_GINDEX>

_COMM_SIZE_B		=	<_S_OFFSET>

version (fg_td)
{
struct TDBG_SYMBOL_STRUCT
{
    ubyte _TDBG_S_FLAGS;	// DEBUG TYPE COMPRESSED.
    ubyte _TDBG_S_BP_FLAGS;	// TDBG STUFF
    ushort _TDBG_S_SRC_MOD;	// SOURCE FILE DEFINING THIS GUY
    ushort _TDBG_S_LINNUM;	// LINE NUMBER...
    ushort _TDBG_S_TID;		// TURBO TYPE INDEX
}
}
